package com.example.my_flea_street.Mapper;

import com.example.my_flea_street.bean.Info;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SquareMapper {
    @Select("SELECT b.id ,b.release_time,b.text,b.pic,b.category,b.key_word,b.is_settled,b.is_banned,b.user_id,a.name,a.sex,a.head FROM user a,information b WHERE a.id=b.user_id ORDER BY release_time desc")
    Page<Info> getInfo();

    @Insert("insert into is_reported_info(release_time,info_id) values(#{release_time},#{info_id})")
    @Options(useGeneratedKeys = true)
    void report(@Param("info_id") int info_id, @Param("release_time") String release_time);
}
